<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        //1.对象属性的简洁表示
        //变量name直接写在大括号里面, 属性名就是变量名, 属性值就是变量值
        let name = "老陈醋"
        let obj = { name }
        console.log(obj)


        // 2.属性名表达式
        obj.foo = true;
        obj['a' + 'bc'] = 123;

        // 相当于
        var obj = {
            foo: true,
            abc: 123
        };
    </script>
</body>

</html>